#ifndef __DHT11_H__
#define __DHT11_H__

#include "stm32f4xx.h"
#include <stdint.h>
#include <stdbool.h>

typedef struct dht11
{
    GPIO_TypeDef* port;
    uint32_t      pin;
    double        temperature;
    double        humidity;
    bool          init;
} DHT11_t;

int dht11_init(DHT11_t *dht11, GPIO_TypeDef* port, uint32_t pin);
int dht11_readvalue(DHT11_t *dht11);

#endif /* __DHT11_H__ */
